package BanyuanClub.Study.Day0309.锁相关3;

public class Dog extends Thread{
    private Guantou guantou;

    public Dog(Guantou guantou){
        this.guantou = guantou;
    }

    @Override
    public void run() {
        guantou.eated();
    }

    public static void main(String[] args) {
        Guantou guantou = new Guantou();
        Dog d1 = new Dog(guantou);
        Dog d2 = new Dog(guantou);
        d1.start();
        d2.start();
    }
}
